home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000070_icon-group-sender _Wed Nov 4 21:38:57 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 10 Nov 1992 04:51:12 MST
  2. Date: 4 Nov 92 21:38:57 GMT
  3. From: access.usask.ca!sue!hercules.cs.uregina.ca!skagos@decwrl.dec.com  (P. Takis Skagos)
  4. Organization: University of Regina, SK, Canada
  5. Subject: Re: Character manipulation
  6. Message-Id: <1992Nov04.213857.23013@sue.cc.uregina.ca>
  7. References: <1992Nov2.031951.18774@midway.uchicago.edu>, <1992Nov03.172737.619209@sue.cc.uregina.ca>, <1992Nov4.020047.3235@midway.uchicago.edu>
  8. Sender: icon-group-request@cs.arizona.edu
  9. To: icon-group@cs.arizona.edu
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. In article <1992Nov4.020047.3235@midway.uchicago.edu> goer@midway.uchicago.edu writes:
  14. >skagos@hercules.cs.uregina.ca (P. Takis Skagos) writes:
  15. >>Well ... my character manipulation problems concerned parsing out
  16. >>lines and performing all sorts of substitutions and stuff (pre-processing
  17. >>a file).  It is do-able with all the line scanning features of Icon,
  18. >>but it is a real drag.  Oh well.
  19. >
  20. >Give us some examples!
  21.  
  22. I cannot give examples ... part of this is for a class assignment ... and
  23. if I post the code I've written so far, others might copy it.  UGH!  Anyway,
  24. what the problem concerns is parsing a Pascal program and removing any white
  25. space that is not required (comments, spaces, tabs, etc.).  Actually, the
  26. only place in Pascal that spaces are required ar around key-words (BEGIN,
  27. END, IF, WHILE, etc ...) and within quote-delimeters (ex: write('hi there') ).
  28. I've written the program in about 31 lines of Icon ... by reading a line
  29. in at a time and then using line indexing (ie: line[i:j]) to format it
  30. the way I want it.  However, this involves having to constantly check
  31. previous and next characters in the line (around our current position
  32. in the line).  I just think that there must be an easier way to do this.
  33.  
  34. Anyway, to appease you code-freaks :-) I will post my code after the
  35. assignment is handed in ... the 12'th or something like that, but for now,
  36. I cannot post it .... Sorry.
  37.  
  38.   P. Takis Skagos
  39.   (skagos@cs.uregina.ca)
  40.